package cn.wolfcode.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.HashMap;

@Setter
@Getter
public class Notice {
    private Long id;

    private Employee issuer; //发布人

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date pubdate; //发布时间

    private String title; //公告标题

    private String content; //内容

    private boolean read; //是否已读

    public String getJson(){
        HashMap map = new HashMap();
        map.put("id",id);
        map.put("title",title);
        map.put("content",content);
        return JSON.toJSONString(map);
    }
}